home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!als-il4-45
- From: stefmit@ix.netcom.com
- Newsgroups: comp.lang.c++
- Subject: Help - what's wrong with this?
- Date: 20 Apr 1996 19:56:29 GMT
- Organization: Netcom
- Message-ID: <4lbfhd$4qo@dfw-ixnews5.ix.netcom.com>
- NNTP-Posting-Host: als-il4-45.ix.netcom.com
- X-NETCOM-Date: Sat Apr 20 2:56:29 PM CDT 1996
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
- Here it is (just snippets of a much larger thing, that I am trying to slice in
- pieces, so that I find out what's wrong one step at a time):
-
- // This appears in the "step1.h" file
-
- class file_io
- { public:
-
- // Member functions to process the file
- void process_in (ifstream &FileName); // Reads in the data
- //from file
- // this is line 218
- void process_out(ofstream &FileName); // Saves the data in
- //the required format
- // this is line 223
-
- };
-
-
- // This appears in the "definit1.cpp" where_I_define_things file
- // Obviously includes the above "test1.h"
-
- void file_io :: process_in (ifstream &FileName)
- { char my_letter;
- int my_int;
- char my_name[45];
- while (FileName >> my_letter >> my_int >> my_name)
- cout << my_letter << " " << my_int << " " << my_name << endl;
- }
-
-
- // This is the main function - the program is much larger, but I was
- // trying to figure out errors one at a time, by calling each function
- // separately
-
- void main ()
- { file_io currfile;
- ifstream InFile ("test1.dat");
- if (!InFile)
- cout << "Error opening file" << "test1.dat" << endl;
- else { while (InFile)
- { clrscr();
- currfile.process_in(InFile);}
- }
- }
-
- The error I am getting:
-
- Compiling DEFINIT1.CPP:
- Error STEP1.H 218: ) expected
- Error STEP1.H 223: ) expected
- Error DEFINIT1.CPP 8: 'file_io::process_in(ifstream &)' is not a member of
- 'file_io'
-
- Could anybody help, please? TIA.
-
-
-
-